import 'package:flutter/material.dart';
import '../Form.dart';

class CategoryPage extends StatefulWidget {
  CategoryPage({Key? key}) : super(key: key);

  @override
  State<CategoryPage> createState() => _CategoryPageState();
}

class _CategoryPageState extends State<CategoryPage> {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
        length: 10,
        child: Scaffold(
          appBar: AppBar(
            title: Row(
              children: <Widget>[
                Expanded(
                  child: TabBar(
                      isScrollable: true,
                      labelColor: Colors.green,
                      indicatorColor: Colors.green,
                      unselectedLabelColor: Colors.white,
                      indicatorSize: TabBarIndicatorSize.label,
                      tabs: <Widget>[
                        Tab(
                          text: "热销",
                        ),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                        Tab(text: "推荐"),
                      ]),
                )
              ],
            ),
          ),
          body: TabBarView(children: <Widget>[
            ListView(children: <Widget>[
              ListTile(
                title: Text("第一个tab"),
              ),
              ListTile(
                title: Text("第一个tab"),
              ),
              ListTile(
                title: Text("第一个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
            ListView(children: <Widget>[
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
              ListTile(
                title: Text("第二个tab"),
              ),
            ]),
          ]),
        ));
  }
}
